#pragma once
#include "stdafx.h"
#include <winsock2.h>
#include <boost/noncopyable.hpp>

#include "Types.h"
#include "Element.h"
static const std::string CLIENT_IP = "localhost"; // address used to accept data from server
static const std::string CLIENT_PORT = "8081";
class JsonClientServer:private boost::noncopyable
{
private:
	JsonClientServer(void);
	static JsonClientServer* jsonClientServer;
	std::string serverIp;
	std::string serverPort;
	 
public:	
	~JsonClientServer(void);
	static JsonClientServer* getInstance();
	void initial(void);
	// a block connect to test if the server is available
	bool connectServer(std::string serverIp, std::string serverPort);
	//register the query on the server 
	bool registerQuery(std::string query,  void (*callBackFunction)(Element& element));
	void execute(void);
};

